home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 145_01 / roff4.doc < prev    next >
Text File  |  1980-01-01  |  35KB  |  1,068 lines

  1. March 10, 1984
  2.             ROFF4, V1.60
  3.  
  4.            by Ernest E. Bergmann
  5.            Physics, Building #16
  6.              Lehigh University
  7.             Bethlehem, PA 18015
  8.  
  9.  
  10.     ROFF4 is an expanded version of ROFF, based on the
  11. formatter in Kernighan and Plauger's book SOFTWARE TOOLS, is
  12. written in BDS C, and employs the directed i/o functions
  13. that go along with that package.  Well, half of the directed
  14. I/O anyway - it doesn't use redirected input because more
  15. than one file can be used as input for a run.  So that some
  16. of the input files may be used to "set-up" the formatter for
  17. a particular style and for particular hardware.  It is
  18. possible to substitute keyboard input instead of files for
  19. educational and test purposes.
  20.  
  21.     ROFF was provided by Neal Somos for the public
  22. domain via the BDS 'C' Users' Group's volume, CUG -- "Just
  23. Like Mom's".  Some of this documentation started there as
  24. well.
  25.  
  26.     This formatter contains features important for the
  27. preparation of technical manuscripts.  Special symbols or
  28. fonts that can be defined by or for the user can be produced
  29. (if the hardware is capable!).  Super and subscripts can be
  30. handled as well as backspace even for printers without
  31. reverse scrolling or backspacing hardware capabilities.
  32. However, the output device should recognize separately the
  33. <CR> and <LF> functions.  The Epson MX-80 with GRAFTRAX 80
  34. was used by the author for most of the development, however
  35. he also was able to use the video display of the Exidy
  36. Sorcerer, which has user definable graphics.  "Preprocessor"
  37. directives can be used to merge stock phrases, boiler plate,
  38. make macro definitions, automate numbering, and create
  39. diversions (for footnotes, table of contents, etc.)
  40.  
  41.     To support the capabilities of WORDSTAR[tm by
  42. MicroPro] extended underlining, strikeout, and multiple
  43. strike capability are provided as well.
  44.  
  45.     For more details on the directed I/O see the files,
  46. NDIO.C and DIO.H that are included here for completeness, but
  47. came from CUG--"Just Like Mom's".
  48.  
  49.  
  50. Sample calls:(recommended to use console, files (">") and
  51.         list (")") only; printer and robot-typewriter
  52.         are not implemented for my system)
  53.  
  54. A>roff4 filename1 filename2 filename3 +}
  55.  
  56.     this would send the formatted version of these three
  57.     files to the console and to the printer
  58.  
  59.  
  60. A>roff4 filename1 +}]>filename1
  61.  
  62.     this would format filename1 and send it to the printer,
  63.     console, robot-typewriter, and back to filename1.
  64.  
  65. A>roff4 -s -f filename1 -b filename2 -f -m -r -d -i -g -*
  66.  
  67.     The option, -s, causes the formatter to stop (pause)
  68.     at the start of each page of output; the bell at the
  69.     console is sounded (if it exists!) and the program
  70.     waits until any key is pressed at the console.  It
  71.     is essential for printers that are feed single sheets
  72.     at a time!
  73.  
  74.     An option that was not shown above, -o[page or range],
  75.     is used to selectively generate output of ONLY certain
  76.     pages.  It is useful to retype pages that got "eaten"
  77.     by the printer (Henry Harpending's aptly put language).
  78.     To retype only page 23, say, make the option: -o23
  79.     To retype pages 23 through 29 use: -o23-29
  80.     To retype pages 23 to the end use: -23-
  81.     These options changes the values of the internal
  82.     variables, FIRSTPAGE and LASTPAGE which originally
  83.     have the values of 1 and 30000, respectively.  Normally
  84.     this option would be placed early enough in the
  85.     command line that no pages have been printed yet.
  86.  
  87.     The option, -f, would introduce a formfeed (0CH)
  88.     into the output stream (useful for placing blank
  89.     pages, or aligning printer pages) where it appears;
  90.     in this example, before the first page of output,
  91.     and, again, at the very end of the output.
  92.  
  93.     The option, -b,  turns on the "debug" flag so as to
  94.     print out lots of diagnostics to the STDERR[console].
  95.     Probably only useful for those who are trying to
  96.     trace the operation of the formatter for elusive
  97.     "bugs".
  98.  
  99.     The option, -m, causes a list of macro definitions
  100.     to be typed to the console.  It is a useful tool for
  101.     debugging complex macro packages where the 
  102.     preprocessor's expansions are too subtle for humans.
  103.  
  104.     The option, -d, causes a list of diversion files to
  105.     be typed to the console.  Its main virtue is to
  106.     remind the user what files are being generated and
  107.     their approximate size.
  108.  
  109.     The option, -i, causes a list of string insertions
  110.     to be typed to the console.  Useful for macro writers,
  111.     as was the -m, described above.  Also, for noting
  112.     what are the settings of "standard substitutions",
  113.     such as "today's date".
  114.  
  115.     The option, -r, causes a list of number registers to
  116.     be typed to the console.  Could be useful to find
  117.     the number of footnotes, etc.
  118.  
  119.     The option, -g, causes a glossary of defined
  120.     translated characters to be printed on the output
  121.     device.  It is useful to check the appearance of
  122.     all special definable characters and to produce
  123.     a "wall chart" of special characters available.
  124.  
  125.     The default option, -*, (the * could be any
  126.     unassigned option) means keyboard input (buffered
  127.     line-by-line with a prompt with the character used in
  128.     the option, here *).  Typing a control-Z indicates
  129.     an end-of-file; the formatter will continue with the
  130.     next named file.  It is intended as a learning aid
  131.     since one can tryout "tricky" input such as
  132.     equations.  As with standard CP/M, a control-P can
  133.     be used to toggle the printer to display output
  134.     that would normally be sent to the console; also,
  135.     one can edit the keyboard input with the backspace
  136.     key.
  137.  
  138.     Using ROFF4, you can make nice printouts of a file,
  139. with as little or as much help from the program as you want,
  140. depending on the commands.  There are default values for all
  141. parameters, so if you don't put any commands in at all, your
  142. file will come out with filled, right-justified lines.  The
  143. default line-length is 60 characters; the default page-
  144. length is 66 lines per page.  "Filled lines" means that as
  145. many input words as possible are packed onto a line before
  146. it is printed; "non-filled" lines go through the formatter
  147. w/o rearrangement.  "Right-justified" simply means that
  148. spaces are added between words to make all the right margins
  149. line up nicely.  To set a parameter, use the appropriate
  150. commands below. All commands have the form of a period
  151. followed by two letters. A command line should have nothing
  152. on it but the command and its arguments (if any); any text
  153. would be lost. 
  154.  
  155.     Extra space will separate text sentences.  The sentence
  156. is recognized by a trailing ':',';','!','?', or a '.'.  For
  157. the '.' there is the additional requirement that either two
  158. or more spaces must spaces must follow it, or that it is at the
  159. end of the source line.
  160.  
  161.         A command argument can be either ABSOLUTE or RELATIVE : 
  162.  
  163. .in    5    sets the indent value to 5 spaces
  164.  
  165. .in    +5    sets the indent value to the CURRENT value+5
  166.  
  167. .ls     -1    sets the line spacing to the current value-1
  168.  
  169.  
  170.     Also,  all commands have a minimum and maximum value
  171. that will weed out any odd command settings (like setting
  172. the line spacing to zero, for example. It won't let you do
  173. that, but it could be changed if you REALLY have a burning
  174. desire to do so).
  175.  
  176.     Some commands cause a "break", which is noted in the
  177. table below.  Before such a command goes into effect, the
  178. current line of text is put out, whether it is completely
  179. filled or not. (this is what happens at the end of a
  180. paragraph, for example.)  A line beginning with spaces or a
  181. tab will cause a break, and will be indented by that many
  182. spaces (or tabs) regardless of the indent value at that time
  183. (this is a "temporary indent", which can also be set
  184. explicitly).  An all blank line also causes a break.  If you
  185. find that some lines that are indented strangely, and it's
  186. not obvious WHY, look at which commands are causing a break,
  187. and which aren't. For instance:
  188.  
  189. .fi
  190. .ti 0
  191. this is a line of text
  192. .in 8
  193.                     <- blank line
  194. more text for the machine to play with
  195.  
  196.  
  197. At first glance it seems obvious that the line "this is a
  198. line of text" will be indented zero spaces, but it won't -
  199. it will be indented 8. The indent command does NOT cause a
  200. break (although the .ti does) so it